package com.isoft.systemprovidor.controller.perinfor;

import com.isoft.systemprovidor.bean.ResponseData;
import com.isoft.systemprovidor.controller.BaseController;
import com.isoft.systemprovidor.entity.perinfor.Perinfor_Basic;
import com.isoft.systemprovidor.service.perinfor.Perinfor_Basic_Service;
import lombok.extern.slf4j.Slf4j;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@CrossOrigin
@RestController
@Slf4j
@RequestMapping("/systemprovidor/perinforbasic")
public class Perinfor_Basic_Controller extends BaseController {
    @Autowired
    Perinfor_Basic_Service service;
    /*验证身份证号*/
    @GetMapping("/idcardisexist")
    public ResponseData idcardIsExist(String idcard){
        return service.idcardIsExist(idcard);
    }


    /*查看个人基础信息*/
    @GetMapping("/getmybasic")
    public ResponseData selectMyBasic(String sysuserid){
        return service.selectMyBasic(sysuserid);
    }
    /*修改个人基础信息*/
    @PutMapping("/updatemybasic")
    public ResponseData<Boolean> changeMyBasic( @RequestBody Perinfor_Basic perinforBasic){
        return returnBoolean(service.changeMyBasic(perinforBasic));
    }
    /*添加个人基础信息*/
    @PostMapping("/addmybasic")
    public ResponseData<Object> insertMyBasic(Perinfor_Basic perinforBasic){
        return returnObject(service.insertMyBasic(perinforBasic));
    }
    /*删除自己个人基础信息*/
    @DeleteMapping("/deletemybasic")
    public ResponseData<Boolean> deleteMyBasic(Integer id ,String sysuserid){
        return returnBoolean(service.deleteMyBasic(id , sysuserid));
    }
}
